<template>
	<globalModal :title="title" :visible="visible" :confirmLoading="confirmLoading" @ok="handleOk" @cancel="handleCancel">
		<a-spin :spinning="confirmLoading">
			<a-form :form="form" autocomplete="off" :labelCol="labelCol" :wrapperCol="wrapperCol">
				<a-form-item  label="字典名称">
					<a-input
						placeholder="字典名称"
						v-decorator="[
							'dictName',
							{ rules: [{ required: true, message: '请输入字典名称' }, { max: 50, message: '字典名称不超过50个字符' }], getValueFromEvent: removeSpaces }
						]"
					/>
				</a-form-item>
				<a-form-item label="字典编码">
					<a-input
						placeholder="字典编码"
						v-decorator="[
							'dictCode',
							{ rules: [{ required: true, message: '字典编码' }, { max: 20, message: '字典编码不超过20个字符' }], getValueFromEvent: removeSpaces }
						]"
					/>
				</a-form-item>
				<a-form-item label="状态">
					<a-radio-group v-decorator="['status', { initialValue: '0', rules: [{ required: true, message: '请选择状态' }] }]">
						<a-radio value="0">启用</a-radio>
						<a-radio value="1">停用</a-radio>
					</a-radio-group>
				</a-form-item>
				<a-form-item label="字典描述">
					<a-textarea
						placeholder="字典描述"
						v-decorator="['description', { rules: [{ max: 200, message: '字典描述不超过200个字符' }], getValueFromEvent: removeSpaces }]"
					/>
				</a-form-item>
			</a-form>
		</a-spin>
	</globalModal>
</template>

<script>
import { ModalMixins } from '@/mixins';
export default {
	name: 'addOrEditDictModal',
	mixins: [ModalMixins],
	data() {
		return {};
	},
	created() {},
	methods: {}
};
</script>
